{template header}
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<style type="text/css">
    td, th {

    }

    .table-striped th,
    .table-striped td  { text-align: center;}
</style>
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<h4 style="padding-left:10px;;">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<div class="row">
<form class="form-horizontal" method="post" action="">
    <div class="control-group search-group">
        <label class="control-label" >昵称：</label>
        <div class="controls">
          <input type="text" name="nickname" value="{$search['nickname']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >uid：</label>
        <div class="controls">
          <input type="text" placeholder="" name="uid" value="{$search['uid']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >手机号：</label>
        <div class="controls">
          <input type="text" placeholder="" name="phone" value="{$search['phone']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >订单号：</label>
        <div class="controls">
          <input type="text" placeholder="" name="order_id" value="{$search['order_id']}">
        </div>
    </div>
    <div class="control-group search-group"style="margin:0;">
        <label class="control-label" >开始日期：</label>
        <div class="controls">
            <input type="text" name="startDate" id="start_time_id" value="{$search['startDate']}">
            <button name="start_time_btn" type="button" id="start_time_btn" onclick="return showCalendar('start_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'start_time_btn');" class="button" id="start_time_id"/>选择</button>
        </div>
    </div>
    <div class="control-group search-group" style="margin:0;">
        <label class="control-label" >结束日期：</label>
        <div class="controls">
            <input type="text" name="endDate" id="end_time_id" value="{$search['endDate']}">
            <button name="end_time_btn" type="button" id="end_time_btn" onclick="return showCalendar('end_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'end_time_btn');" class="button" id="end_time_id"/>选择</button>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >订单状态：</label>
        <div class="controls">
          <select name="status">
            <option value="0">全部</option>
            {loop $orderStatus $k $v}
            <option value="{$k}" {if $k==$search['status']}selected{/if}>{$v}</option>
            {/loop}
          </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >订单类型：</label>
        <div class="controls">
          <select name="act_type">
            <option value="-1">全部</option>
            {loop $actType $k $v}
            <option value="{$k}" {if $k==$search['act_type']}selected{/if}>{$v}</option>
            {/loop}
          </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >运单编号：</label>
        <div class="controls">
          <input type="text" placeholder="" name="shipping_num" value="{$search['shipping_num']}">
        </div>
    </div>
    <div class="control-group search-group">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>
</div>
<script>
       function uploadExcel() {
        if($("#excelFile").val() != '') $("#excel_form").submit();
    }
  </script>
<div class="row">
  <h4 style="padding-left:10px;;">
    <span>导入导出</span>
  </h4>
  <form id="excel_form" method="post" action="/index.php?c=adminErp&a=getErpOrderImportExcel" enctype="multipart/form-data">
    <input type="file" name="excelFile" id="excelFile" style="display:none;" onchange="uploadExcel();">
    <button type="button" id="file_upload_btn" class="btn btn-primary" onclick="$('#excelFile').trigger('click')">
                <i class="ace-icon fa fa-cloud-upload bigger-110"></i>导入
    </button>
    <a class="btn" href="?c=adminErp&a=getErpOrderExportExcel">导出</a>
  </form>
  
</div>
<div class="bs-docs-example" style="clear:both; padding-top: 30px;">
    <table class="table table-striped">
        <thead>
            <tr >
                <th>创建时间</th>
                <th>订单编号</th>
                <th style="width:60px;">昵称</th>
                <th style="display: none;">uid</th>
                <th style="display: none;">收货手机号</th>
                <th>金额</th>
                <th>订单类型</th>
                <th>活动ID</th>
                <th>订单状态</th>
                <th>支付状态</th>
                <th>运单编号</th>
                <th>是否达标</th>
            </tr>
        </thead>
        <tbody>
            {loop $orderList $k $v}
            <tr id="{$v['id']}">
                <td>{eval echo date('Y-m-d H:i:s',$v['addtime'])}</td>
                <td><a href="?c=admin&a=orderInfo&id={$v['id']}">{$v['order_id']}</a></td>
                <td>{$v['user']['nickname']}</td>
                <td>{$v['uid']}</td>
                <td style="display: none">{$v['phone']}</td>
                <td>{$v['total_fee']}</td>
                <td>{eval echo $actType[$v['act_type']]}</td>
                <td>{eval echo $v['aid'] ? $v['aid'] : $v['act_id']}</td>
                <td>{eval echo $orderStatus[$v['status']]}</td>
                <td>{eval echo $payStatus[$v['pay_status']]}</td>
                <td>{$v['shipping_num']}</td>
                <td>{eval echo $v['dabiao'] ? '是': ''}</td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
{template footer}
